package com.zhou.jiancai.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.zhou.jiancai.R;
import com.zhou.jiancai.entbusData.DataSynEvent;

import org.greenrobot.eventbus.EventBus;

/**
 * Created by Administrator on 2017/6/12.
 */

public class EntBusTest1Activity extends AppCompatActivity {

    private static final String TAG ="EntBusTest1Activity" ;
    private TextView tv_entbus1;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.entbustest2);

        tv_entbus1 = (TextView) findViewById(R.id.tv_entBus1);
        tv_entbus1.setText("点击按钮回到原来的activity就能收到信息"+"------");

        Button button1= (Button) findViewById(R.id.Button_test1);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                EventBus.getDefault().post(new DataSynEvent(500));
                finish();
            }
        });




    }

    @Override
    protected void onStart() {
        super.onStart();

    }



    @Override
    protected void onDestroy() {

        super.onDestroy();
    }
}
